package com.gmics.unifiq.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.gmics.unifiq.fragment.CompareCoursesFragment;
import com.gmics.unifiq.fragment.EventTab;
import com.gmics.unifiq.fragment.FriendsFragment;
import com.gmics.unifiq.fragment.GroupFragment;
import com.gmics.unifiq.fragment.HomeFragment;
import com.gmics.unifiq.fragment.OpenEventTab;

public class HomePager extends FragmentPagerAdapter {
	private String[] tabTitle = { "Newsfeed", "Group", "Group Event", "Uni Event", "Compare Courses"};

	public HomePager(FragmentManager fm) {
		super(fm);
	}

	@Override
	public int getCount() {
		return tabTitle.length;
	}

	@Override
	public Fragment getItem(int i) {
		switch (i) {
		case 0:
			return new HomeFragment();

		case 1:
			return new GroupFragment();

		case 2:
			return new EventTab();
		
		case 3:
			return new OpenEventTab();
			
		case 4:
			return new CompareCoursesFragment();

			
		default:
			return null;
		}
	}

	@Override
	public CharSequence getPageTitle(int position) {
		return tabTitle[position];
	}

}